package com.bweab.controll.depositcontroll.en;

import com.bweab.dao.api.En.DepositTbDaoEnInterface;
import com.bweab.service.api.en.DepositTbEnServiceInterface;
import com.bweab.service.impl.en.DepositTbEnServiceInterfaceImpl;
import com.bweab.util.PageList;
import com.bweab.util.WebUtil;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebServlet("/queryDepositInfoByUserId")

public class QueryDepositByUserId extends HttpServlet {


    //创建虚体服务
    DepositTbEnServiceInterface depositTbEnService =new DepositTbEnServiceInterfaceImpl();

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //获取数据
        int userId= Integer.parseInt(req.getParameter("userId"));
        //获取页数
        int page = Integer.parseInt(req.getParameter("page"));
        //获取页面大小
        int pageSize= Integer.parseInt(req.getParameter("pageSize"));


        //页面数据
        //调用service
        PageList pageList= depositTbEnService.queryDepositInfoByUserId(userId,page,pageSize);


        //返回结果
        WebUtil.writeJson(resp,pageList);
    }
}
